<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
		<#include "../include/top.html">
	<link rel="stylesheet" href="${realpath}/resources/css/admin-public.css" />
	<link rel="stylesheet" type="text/css" href="${realpath}/resources/webuploader/webuploader.css">
	<script type="text/javascript" src="${realpath}/resources/webuploader/webuploader.min.js"></script>
	<script type="text/javascript" src="${realpath}/resources/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" src="${realpath}/resources/ueditor/ueditor.all.js"></script>
	<script type="text/javascript" charset="utf-8" src="${realpath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
	<script type="text/javascript" charset="utf-8" src="${realpath}/resources/ueditor/MyActionUrl.js"></script>
	<link rel="stylesheet" type="text/css" href="${realpath}/resources/webuploader/webuploader.css">
	<script language="javascript" type="text/javascript" src="${realpath}/resources/datePicker/WdatePicker.js"></script>
	<link rel="stylesheet" href="${realpath}/resources/css/addblog.css" />
	<script type="text/javascript">
		fzqblog.background = "${user.userBg}";
	</script>
	<title>后台管理</title>
</head>
<body>
<div>
	<nav class="leftNav navbar-default">
			<ul class="first-nav-level nav">
				<li class="nav-header">
					<span><a href="${realpath}/user/${user.userid?c}" style="padding: 0px;"><img alt="image" class="img-circle img" src="${user.userIcon}"></a></span>
					<span class="adminUser">${user.userName}</span>
				</li>
				<li>
					<a href="#" class="mycollapse">
          				<span class="glyphicon glyphicon-user"></span>
						<span>个人信息管理</span>
						<span class="fa arrow">+</span>
					</a>
					<ul class="second-nav-level nav collapse" id="collapse">
						<li><a href="${realpath}/admin" >修改个人资料</a></li>
						<li><a href="${realpath}/admin/preUpdatePassword">修改登录密码</a></li>
						<li><a href="${realpath}/admin/preUpdateUserIcon">修改头像</a></li>
						<li><a href="${realpath}/admin/preUpdateUserBg">修改主页背景</a></li>
						<!-- <li><a href="${realpath}/admin/preUpdateUserPage">版面设置</a></li> -->
					</ul>
				</li>
				<li>
					<a href="#" class="mycollapse">
						<span class="glyphicon glyphicon-book"></span>
						<span>博客管理</span>
						<span class="fa arrow">-</span>
					</a>
					<ul class="second-nav-level nav in" id="collapse">
						<li><a href="${realpath}/admin/blogList" class="activeNav" >我的博文</a></li>
						<li><a href="${realpath}/admin/preAddBlog">发表博文</a></li>
						<li><a href="${realpath}/admin/draftBlogList">博文草稿箱</a></li>
						<li><a href="${realpath}/admin/blog_category">博文分类管理</a></li>
					</ul>
				</li>
				<li>
					<a href="#" class="mycollapse collapse">
						<span class="glyphicon glyphicon-envelope"></span>
						<span>消息管理</span>
						<span class="fa arrow">+</span>
					</a>
					<ul class="second-nav-level nav collapse" id="collapse">
						<li><a href="${realpath}/admin/messageList">我的消息</a></li>
					</ul>
				</li>
				<li>
					<a href="#" class="mycollapse">
						<span class="glyphicon glyphicon-heart"></span>
						<span>收藏管理</span>
						<span class="fa arrow">+</span>
					</a>
					<ul class="second-nav-level nav collapse" id="collapse">
						<li><a href="${realpath}/admin/collection_list.action?articleType=T">收藏的帖子</a></li>
						<li><a href="${realpath}/admin/collection_list.action?articleType=K">收藏的知识库</a></li>
						<li><a href="${realpath}/admin/collection_list.action?articleType=A">收藏的问答</a></li>
						<li><a href="${realpath}/admin/collection_list.action?articleType=B">收藏的博文</a></li>
					</ul>
				</li>
			</ul>
	</nav>


	<div class="rightTopNav" style="margin-left: 200px;background: #18bc9c;">
		<nav class="navbar navbar-inverse navbar-static-top" style="">
				<div class="navbar-header">
			      <a class="navbar-brand">JAVABLOG</a>
			   </div>
		       	<ul class="nav navbar-top-links navbar-right">
		            <li class=""><a href="${realpath}">首页</a></li>
			        <li><a href="${realpath}/shuoshuo">说说</a></li>
			        <li><a href="${realpath}/exam">在线考试</a></li>
			        <li><a href="${realpath}/bbs">讨论区</a></li>
			        <li><a href="${realpath}/knowledge">知识库</a></li>
			        <li><a href="${realpath}/ask">问答</a></li>
		     	</ul>
		</nav>
	</div>
	<div class="mainFrame">

		<form id="postBbsForm">
		<input type="hidden" name="content" id="richContent" />
			<div class="row">
				<div class="form-group" id="topicTitle">
					<label class="col-xs-1 control-label"> <em class="important">*</em>
						标题:
					</label>
					<div class="col-xs-10">
						<input class="form-control"  name="title" id="title" value="${blog.title!''}"></input>
					</div>
				</div>
			</div>

			<div class="row">
				<div class="form-group" id="category">
					<label class="col-xs-1 control-label">&nbsp;&nbsp;&nbsp;
						分类:
					</label>
					<div class="col-xs-3">
						<select class="form-control" name="categoryId" id="categoryId">
							<option value="0">全部分类</option>
							<#list categories as item>
							<option value="${item.categoryId}" <#if blog.categoryId==item.categoryId>selected="selected"</#if>>${item.name}</option>
							</#list>
						</select>
					</div>
				</div>
			</div>

	
			<div class="row">
				<div class="form-group" id="ueContent">
					<label class="col-xs-1 control-label"> <em class="important">*</em>
						内容:
					</label>
					<div class="col-xs-10">
						<script id="editor" type="text/plain" style="width:950px;height:300px;">
							${blog.content!''}
						</script>
					</div>
				</div>
			</div>
			
			<input type="hidden" name="fileName" id="attached_file_name" value="${(blog.attachment.fileName)!''}" />
			<input type="hidden" name="fileUrl" id="attached_file" value="${(blog.attachment.fileUrl)!''}" />
			<input type="hidden" name="attachmentId" id="attachmentId" value="${(blog.attachment.attachmentId)!''}" />
			<input type="hidden" name="blogId" id="blogId" value="${(blog.blogId)!''}" />
			<#if (blog.attachment)??>
					<#assign style="style='display:none;'">	
					<#else>
					<#assign style="style='display:block;'">	
			</#if>
			<div class="row">
				<div class="form-group">
					
					<label class="col-xs-1 control-label">&nbsp;&nbsp;&nbsp;
						附件:
					</label>
					
					<div class="col-xs-1" id="filePicker" ${style}>
							<a class="btn btn-info">上传附件</a>
					</div>
					<div class="col-xs-4" id="fileuploadtip" ${style}>
							<span class="info">大小不能超过2M,只能是.rar、.zip文件</span>
					</div>
					<div id="loading-upload" class="col-xs-1" style="display:none">
							<img src="${realpath}/resources/images/loading.gif">
					</div>
					<div class="col-xs-4" id="file-list" ${style}></div>
					<#if (blog.attachment)??>
						<div class="col-xs-4" id="file-list">
							${(blog.attachment.fileName)!''}&nbsp;&nbsp;<a href="javascript:deleteFile()" class="btn btn-info btn-sm">删除</a>	
						</div>
					</#if>
				</div>
			</div>
			
			<div class="row">
				<div class="form-group" id="needMark">
					<label class="col-xs-1 control-label">&nbsp;&nbsp;&nbsp;
						积分:
					</label>
					<div class="col-xs-1">
						<input class="form-control"  name="downloadMark" id="mark" value="${(blog.attachment.downloadMark)!'0'}"></input>
					</div>
					<div class="col-xs-2">
					 <a href="${realpath}/faq">为什么需要积分</a>
					 </div>
				</div>
			</div>
		</form>


		<div class="row" id="publicBtn">
			<div class="col-xs-10"></div>
			<button class="btn btn-info" id="postExamBtn">保存修改</button>
		</div>
      

	</div>
</div>
	<script type="text/javascript" src="${realpath}/resources/js/admin-public.js"></script>
	<script type="text/javascript" src="${realpath}/resources/js/edit_blog.js"></script>
</body>
</html>